// store/index.js
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    toDetail: ''
  },
  mutations: {
    setToDetail(state, payload) {
      state.toDetail = payload;
    }
  },
  actions: {
    updateToDetail({ commit }, payload) {
      commit('setToDetail', payload);
    }
  },
  getters: {
    toDetail: state => state.toDetail
  }
});
